home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Demos / A.D. Software / OOFILE / Buildable, limited OOFILE / samples / ooftst17.cpp < prev    next >
C/C++ Source or Header  |  1996-02-16  |  1KB  |  53 lines

  1. // Copyright 1994 A.D. Software. All Rights Reserved
  2.  
  3. // OOFTEST17
  4. // see also ooftst07
  5.  
  6. // this sample demonstrates searching and sorting by 
  7. // different types of fields, and how to parameterize
  8. // calls, passing in table and field references
  9.  
  10. // Simple stream I/O is used to interact with the user.
  11. #include "oofile.hpp"
  12.  
  13.  
  14. DECLARE_CLASS(dbPeople)
  15.     dbChar        LastName, Othernames;
  16.     dbLong        Salary, SalaryNoDup;
  17.     dbShort        SalaryShort, SalaryShortNoDup;
  18.     dbReal        SalaryReal, SalaryRealNoDup;
  19.     dbDate        LastVisit, LastVisitNoDup;
  20.     dbUshort    ShortUnsigned;
  21.     dbUlong        LongUnsigned;
  22.  
  23.     dbPeople() :
  24.                 dbTable("People"),
  25.                 LastName(40, "Last Name"),
  26.                 Othernames(80, "Other names"),
  27.                 Salary("Salary"),
  28.                 SalaryNoDup("Salary NoDup"),
  29.                 SalaryShort("SalaryShort"),
  30.                 SalaryShortNoDup("SalaryShortNoDup"),
  31.                 SalaryReal("SalaryReal"),
  32.                 SalaryRealNoDup("SalaryRealNoDup"),
  33.                 LastVisit("LastVisit"),
  34.                 LastVisitNoDup("LastVisitNoDup"),
  35.                 ShortUnsigned("ShortUnsigned"),
  36.                 LongUnsigned("LongUnsigned")                
  37.     {};
  38.     
  39. // my own data entry procedure
  40.     void Add(const char *lname, const char *oname, const long salary, const char* visitDate);
  41. };
  42.     
  43. #include "ooftst07.inc"
  44.  
  45. int main()
  46. {
  47.     cout << "OOFILE Validation Suite - Test 17\n"
  48.          << "Simple test to demonstrate comparative searches" << endl
  49.          << "using a database identical to ooftst07 except without indices" << endl;
  50.     
  51.     doTest07("ooftst17.db");
  52.     return EXIT_SUCCESS;
  53. }